! function (a) {
    a.upp = function (a) {
        this._url = a, this._init()
    }, upp.prototype = {
        _init: function () {
            var a = this._url.split("?"),
                b = 0,
                c = [];
            if (this.host = a[0], this._params = {}, a.length > 1)
                for (c = a[1].split("&"); b < c.length; b++) {
                    var d = c[b].split("=");
                    this.add(d[0], d[1])
                }
        },
        add: function (a, b) {
            return this._params[a] = b, this
        },
        remove: function (a) {
            return delete this._params[a], this
        },
        contains: function (a) {
            return void 0 !== this._params[a]
        },
        update: function (a, b) {
            this._params[a] = b
        },
        get: function (a) {
            return this._params[a]
        },
        all: function () {
            return this._params
        },
        url: function () {
            var a = [];
            for (var b in this._params) a.push(b + "=" + this._params[b]);
            return this.host + (a.length > 0 ? "?" : "") + a.join("&")
        }
    }
}(window),
function () {
    if (window._T) {
        var a = document.getElementsByTagName("body")[0],
            b = function (a, b, c) {
                a.addEventListener ? a.addEventListener(b, c, !1) : a.attachEvent && (a["e" + b + c] = c, a.attachEvent("on" + b, function () {
                    a["e" + b + c].call(a, window.event)
                }))
            };
        a && b(a, "click", function (a) {
            for (var b = a.target || a.srcElement; b !== document && b !== document.body && !b.getAttribute("ka") && b.parentNode;) b = b.parentNode;
            var c = b.getAttribute("ka");
            if (c) {
                var d = b.getAttribute("href") || "";
                if (d && 0 !== d.indexOf("#") && -1 === d.indexOf("javascript:;") && !b.getAttribute("noa")) {
                    var e = new window.upp(d);
                    e.add("ka", encodeURIComponent(c)), b.setAttribute("href", e.url())
                }
                _T.sendEvent(c, d)
            }
        })
    }
    //页面时长
    var entryTime = Date.parse(new Date());
    window.onunload = onunload_handler;
    function onunload_handler() {
        var leaveTime = Date.parse(new Date());
        var timeLen = (leaveTime - entryTime) / 1000
        _T.sendEvent('access-time', '' + timeLen + '');
    }
}();